package com.njmaomao.gj.pyot.common.exception;


import com.njmaomao.gj.pyot.common.bean.BaseResponse;

/**
 * 远程调用业务失败
 */
public class RemoteCallBizException extends RuntimeException {

    private static final long serialVersionUID = 450681067074732794L;

    private String systemCode;
    private String respCode;
    private String respDesc;

    public RemoteCallBizException(String systemCode, String respCode, String respDesc) {
        super(systemCode + ":" + respCode + "=" + respDesc);
        this.systemCode = systemCode;
        this.respCode = respCode;
        this.respDesc = respDesc;
    }

    public RemoteCallBizException(String systemCode, BaseResponse response) {
        super(systemCode + ":" + response.getCode() + "=" + response.getDesc());
        this.systemCode = systemCode;
        this.respCode = response.getCode();
        this.respDesc = response.getDesc();
    }

    public String getCode() {
        return this.systemCode + ":" + this.respCode;
    }

    public String getDesc() {
        return respDesc;
    }

}
